
let user = require("../models/userDetail")

var express = require('express');
var router = express.Router();

const formidable = require('formidable');

//返回图片
router.post('/', (req, res, next) => {
    var form = new formidable.IncomingForm();
    form.parse(req, async function (err, fields, files) {
        if (err) {
            res.json({ 'state': false })
        } else {
          let student = await user.find({
            UUID: fields.UUID
          })
          console.log(!student[0].wordViewFlag)
          if(!student[0].wordViewFlag){
            res.json({
              'state': true,
              'res': false
            })
          } else {
            res.json({
              'state': true,
              'res': true
            })
          }
        }

    });

});

module.exports = router;